import barcode
import base64
from barcode import ImageWriter
import StringIO


def create(code=''):
    EAN = barcode.get_barcode_class('ean13')
    ean = EAN(code, writer=ImageWriter())
    fp = StringIO.StringIO()
    ean.write(fp)
    image = base64.b64encode(buffer(fp.getvalue()))
    return image


if __name__ == '__main__':
    s = input()
    print(create(s))
